package com.xyy.saas.payment.controller;

import com.xyy.saas.payment.cores.param.PinganLoanDetailVo;
import com.xyy.saas.payment.cores.param.PinganLoanMyLoanVo;
import com.xyy.saas.payment.cores.vo.PinganLoanDetailDto;
import com.xyy.saas.payment.cores.vo.PinganLoanMyLoanDto;
import com.xyy.saas.payment.cores.vo.ResultVO;
import com.xyy.saas.payment.payment.core.service.PinganLoanService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping(value = {"/api/pinganLoan"})
public class PinganLoanController {
    @Resource
    private PinganLoanService paymentLoanService;

    /**
     * 我的平安贷页面
     */
    @PostMapping(value = "/my_loan")
    public ResultVO<PinganLoanMyLoanDto> myLoan(@RequestBody PinganLoanMyLoanVo pinganLoanMyLoanVo) {
        return paymentLoanService.myLoan(pinganLoanMyLoanVo);
    }

    /**
     * 平安贷明细页面
     */
    @PostMapping(value = "/loan_detail")
    public ResultVO<List<PinganLoanDetailDto>> loanDetail(@RequestBody PinganLoanDetailVo pinganLoanDetailVo) {
        return paymentLoanService.loanDetail(pinganLoanDetailVo);
    }

}
